home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
smaltalk
/
manchest.lha
/
MANCHESTER
/
manchester
/
2.2
/
session_recording_timeshare.st
< prev
next >
Wrap
Text File
|
1993-07-24
|
2KB
|
59 lines
" NAME session_recording_timeshare
AUTHOR Dr Who
FUNCTION needed after session_recording and timeshare
ST-VERSIONS
PREREQUISITES
CONFLICTS
DISTRIBUTION world
VERSION 1.1
DATE 22 Jan 1989
SUMMARY session_recording_timeshare
If you are going to use the session
recording with the timeshare goody file this in after filing in
both the other goodies. This just fixes some of the methods in
InputState so that they combine the two goodies properly.(2.2).RMD
"!
'From Smalltalk-80, Version 2.3 of 13 June 1988 on 27 June 1989 at 1:57:40 pm'!
!InputState methodsFor: 'initialize-release'!
install
"Initialize and connect the receiver to the hardware. Terminate the old input
process if any."
InputProcess == nil ifFalse: [InputProcess terminate].
self initState.
self class startYieldProcess.
InputSemaphore _ Semaphore new.
InputProcess _ [self run] newProcess.
InputProcess priority: Processor lowIOPriority.
InputProcess resume.
self primInputSemaphore: InputSemaphore.
inputMode _ #normal! !
'From Smalltalk-80, Version 2.3 of 13 June 1988 on 27 June 1989 at 2:00:27 pm'!
!InputState class methodsFor: 'private'!
startYieldProcess
"Start the yield process (terminate the old one if it exists),
which does an await (yield to other OS processes) and then
yields to other Smalltalk processes. Called by InputState>>install"
YieldProcess == nil ifFalse: [YieldProcess terminate].
SleepyCount _ 0.
YieldProcess _ [[true]
whileTrue:
[(SleepyCount >= 1000 and: [(Sensor inputState currentInputMode == #playback) not])
ifTrue: [self awaitEvent]
ifFalse: [SleepyCount _ SleepyCount + 1].
Processor yield]] newProcess.
YieldProcess priority: Processor userSchedulingPriority.
YieldProcess resume! !
Sensor inputState install!